PATHMac OS 8 and 9 Developer Documentation > Interapplication Communication > AppleScript for Scripters >

AppleScript Language Guide

   

Duplicate

Duplicate is an application command that copies one or more objects and inserts them either at a location specified in the command or at the location following the copied object or objects.

SYNTAX
duplicate referenceToObject [ to newLocation ]
PARAMETERS
referenceToObject
A reference to the object or objects to be duplicated. Class: Reference
newLocation
The new location for the object. Class: Reference Default value: If you do not specify a new location, the object is inserted at the location immediately following the object specified in the direct parameter.
RESULT

A reference to the new object.

Class: Reference

EXAMPLE

The following example tells the Finder to duplicate a file from the startup disk to a folder on the startup disk. If a file with the same name already exists, it is not replaced.

tell application "Finder"
    duplicate first file of startup disk ¬
        to first folder of startup disk replacing no
end tell

© 1999 Apple Computer, Inc. – (Last Updated 21 May 99)